import { PageHeader, Radio } from 'antd';
import { Button, Checkbox, Form, Input, Select, Progress, Row, Col } from 'antd';
import './index.scss'
import { useNavigate } from 'react-router-dom';
import { CrownOutlined } from '@ant-design/icons'
import { add } from '../../../../../api/paymember_ssh'
import { useEffect, useState } from 'react';
const { Option } = Select;
const routes = [
    {
        path: 'index',
        breadcrumbName: '用户管理',
    },
    {
        path: 'first',
        breadcrumbName: '编辑付费会员卡信息',
    },

];
const Add_paymember = () => {
    useEffect((addmember) => {

    }, [])
    const Navigate = useNavigate()
    const onFinish = (values) => {
        console.log('Success:', values);
        //增加请求
        const addmember = () => {
            add().then((res) => {
                console.log(res);
            })
        }
    };

    const onFinishFailed = (errorInfo) => {
        console.log('Failed:', errorInfo);
    };
    const goback = () => {
        Navigate('/home/user/pay-member')
    }
    return <div className='addpay'>
        <PageHeader
            className="site-page-header"
            title="新建付费会员卡"
            breadcrumb={{
                routes,
            }}

        />
        <div className='content_editor clear'>
            <div className='left'>
                <Form
                    name="basic"
                    labelCol={{
                        span: 6,
                    }}
                    wrapperCol={{
                        span: 18,
                    }}

                    onFinish={onFinish}
                    onFinishFailed={onFinishFailed}
                    autoComplete="off"
                >
                    <Form.Item
                        label="会员卡名称"
                        name="cardName"
                    >
                        <Input />
                    </Form.Item>

                    <Form.Item
                        name="cardOpeningConditions "
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 1,
                            span: 23,
                        }}
                        label="开卡条件"
                    >
                        <Checkbox>付费</Checkbox>
                        <Input suffix="元" placeholder='请输入' className='myinput' />
                    </Form.Item>
                    <Form.Item
                        name="effecticeTime "
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 1,
                            span: 23,
                        }}
                        label="有效期"
                    >
                        <Radio>永久有效</Radio>

                    </Form.Item>
                    <Form.Item
                        name="overTime "
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 7,
                            span: 17,
                        }}

                    >
                        <Radio>自获得之日起 &nbsp;</Radio>
                        <Input placeholder='请输入' className='myinput' />&nbsp;&nbsp;
                        <Select
                            placeholder='请选择单位'
                            className='sele'
                        >
                            <Option value="1">年</Option>
                            <Option value="2">月</Option>
                            <Option value="3">日</Option>

                        </Select>&nbsp; 有效


                    </Form.Item>
                    <Form.Item
                        name="cardRenewalReminder "
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 1,
                            span: 23,
                        }}
                        label="续卡提醒"
                    >
                        <Radio>不提醒</Radio>
                    </Form.Item>
                    <Form.Item
                        name="overTime "
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 7,
                            span: 17,
                        }}

                    >
                        <Radio>距离到期前 &nbsp;</Radio>
                        <Select
                            placeholder='请选择有效期'
                            className='sele'
                        >
                            <Option value="86"></Option>
                            <Option value="87">+87</Option>
                        </Select>&nbsp; 提醒
                    </Form.Item>
                    <Form.Item
                        name="vipCardEquityList"
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 1,
                            span: 23,
                        }}
                        label="会员权益"
                    ><Select
                        placeholder='请选择权益'
                        className='sele'
                    >
                            <Option value="1"> 全部课程免费学习</Option>
                            <Option value="2">商品折扣</Option>
                            <Option value="3"> 积分翻倍</Option>
                            <Option value="4"> 送优惠券</Option>
                            <Option value="5"> 积分翻倍</Option>

                        </Select>
                        &nbsp;&nbsp;
                        <a>选择优惠券</a>
                    </Form.Item>

                    <Form.Item
                        name="remember"
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 7,
                            span: 17,
                        }}
                    >
                        <Checkbox>送积分</Checkbox>
                        <Input suffix="分" placeholder='请输入' className='myinput' /><br />
                        <a>配置会员权益</a>
                    </Form.Item>
                    <Form.Item
                        name="remember"
                        valuePropName="checked"
                        wrapperCol={{
                            offset: 1,
                            span: 23,
                        }}
                        label="卡描述"
                    >
                        <Input.TextArea></Input.TextArea>
                    </Form.Item>
                    <Form.Item
                        wrapperCol={{
                            offset: 8,
                            span: 16,
                        }}
                    >
                        <Button type="primary" htmlType="submit">
                            提交
                        </Button>
                        &nbsp; &nbsp; &nbsp;
                        <Button htmlType="submit" onClick={goback}>
                            返回
                        </Button>
                    </Form.Item>
                </Form>
            </div>
            <div className='right'>
                <div className='car'>
                    <h3 className='myh' >{<CrownOutlined />}月度超级会员</h3>
                    <div className='bottm'>
                        <p>有效期：2020年9月10号到期</p>
                        <p>所有课程免费畅学</p>
                    </div>
                </div>
                <p className='mypp'>会员卡预览</p>
            </div>

        </div>
    </div>
}
export default Add_paymember